home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / BUS / TMCM Software and Labs.sit / Software for TMCM 7_95 / Files for Lab 9 / necklace < prev    next >
Text File  |  1993-10-17  |  1KB  |  25 lines

  1. { This little program draws a circle of radius 5 with
  2.   little circles of radius 1/2 lying outside it and
  3.   tangent to it.  The big circle is drawn as a sequence
  4.   of eighteen 20-degree arcs, and one little circle is drawn
  5.   at the end of each arc. }
  6.  
  7.  
  8. LOOP
  9.  
  10.    arc(5,20)   { draws a twenty degree arc along a circle of radius five;
  11.                  the arc starts at the current turtle position and curves
  12.                  counterclockwise (i.e. to the left of the turtle)--changing
  13.                  the radius to -5 would make it turn to the right; the
  14.                  turtle moves to the endpoint of the arc. }
  15.  
  16.    circle(-0.5)  { circle of raduis 1/2; the minus sign means that the
  17.                    cicle will be drawn to the RIGHT of the turtle; the
  18.                    turtle will end up in the same position as when it starts }
  19.  
  20.    EXIT IF heading = 0   { terminates the loop if the heading of the turtle
  21.                            is zero, that is, if the turtle is facing directly
  22.                            to the right, as it does when the program starts. }
  23.  
  24. END LOOP
  25.